//
//  WmcAttribute.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/5/26.
//

import UIKit

/// 属性类
/// 用于代理回调时，告知外部当前相机的部分入参属性
public struct WmcAttribute {
    /// 当前环境
    public var environmentType: YPWmcManager.EnvironmentType
    
    /// 当前宿主平台
    public var platform: YPWmcManager.Platform
    
    /// 当前多媒体功能入口来源
    public var entry: Int
    
    /// 当前水印组类型
    var watermarkGroupType: YPWmcManager.WatermarkGroupType = .default
    
    /// 附带属性
    public var attached: Any?
    
    /// 当前属性值
    public static var current: WmcAttribute {
        let shared = YPWmcManager.shared
        let map = shared.attachedMap
        let attached = map[shared.entry]
        return .init(environmentType: shared.environmentType,
                     platform: shared.platform,
                     entry: shared.entry,
                     watermarkGroupType: shared.watermarkGroupType,
                     attached: attached)
    }
}
